package com.zhixiang.xaec.service.system.impl;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zhixiang.core.dao.BaseDao;
import com.zhixiang.core.service.impl.BaseServiceImpl;
import com.zhixiang.xaec.dao.system.DicTypeDao;
import com.zhixiang.xaec.entity.system.DicType;
import com.zhixiang.xaec.service.system.DicTypeService;


@Service
public class DicTypeServiceImpl extends BaseServiceImpl<DicType, Long> implements DicTypeService
{

    @Resource(type=DicTypeDao.class)
    public void setBaseDao(BaseDao<DicType, Long> dao)
    {
        setDao(dao);
    }

    @Override
    public DicType findByDicAndIsSys(String dic, Short isSys)
    {
        List<DicType> list=getDao().findByHql("from DicType Where dic=? and isSys=?", new Object[]{dic,isSys});
        if(list.size()>0){
            return list.get(0);
        }
        return null;
    }
    
    @Override
    public DicType findByDic(String dic)
    {
        List<DicType> list=getDao().findByHql("from DicType Where dic=?", new Object[]{dic});
        if(list.size()>0){
            return list.get(0);
        }
        return null;
    }

}
